package com.swallow.auth.api.tenant;

import com.swallow.auth.common.result.Result;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: 18310740596@163.com
 * @date: 2024-05-11 10:17:07
 * @version: v1.0
 * @describe: 租户相关
 */
@FeignClient(url = "http://localhost:10000")
@RequestMapping("tenant")
public interface ITenantFacade {
    /**
     *  创建租户
     *
     * @param tenantName 租户名称
     * @return           创建完成后,返回租户唯一编号
     */
    @GetMapping("create")
    Result<String> create(@RequestParam("tenantName") @NotBlank(message = "租户名称不能为空") @Length(min = 3, max = 32, message = "名称长度不合法") String tenantName);

    @DeleteMapping("delete")
    Result<Void> delete(@RequestParam("tenantNo") @NotBlank(message = "租户编号不能为空") String tenantNo);
}
